<template>
  <div>
    <el-descriptions class="margin-top" title="系统通知信息" :column="3" :size="size"
                     style="width: 90%;margin: auto;padding-top: 20px" border>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-user"></i>
          接收用户名
        </template>
        {{formData.userName}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          通知类型
        </template>
        <el-tag size="small">{{formData.type}}</el-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-mobile-phone"></i>
          发布时间
        </template>
        {{formData.publishTime}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-tickets"></i>
          备注信息
        </template>
        {{formData.remark}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-office-building"></i>
          内容
        </template>
        <div v-if="formData.type==='公司'">
          <div class="image" style="margin-left: 20px">
            <el-image
              style="width: 100px; height: 100px"
              :src="formData.content">
            </el-image>
          </div>
        </div>
        <div v-html="formData.content" style="text-align: left;margin-left: 35px"v-else>
          {{this.formData.content}}
        </div>
      </el-descriptions-item>
    </el-descriptions>
  </div>

</template>

<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/scp/notice";
export default {
  name: "open",
  data(){
    return{
      formData:{}
    }
  },
  created() {
    var noticeId = this.$route.query.noticeId;
    this.init(noticeId)
  },
  methods:{
    init(noticeId){
      getNotice(noticeId).then(response => {
        this.formData = response.data;
        if (this.formData.type == '公司'){
          this.formData.content = "http://101.42.14.198:9000" + response.data.content
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
